package com.jwdf.uda.http.action;

import android.content.Context;

import com.jwdf.uda.bean.PbBean;
import com.jwdf.uda.http.AHttpService;
import com.jwdf.uda.http.ApiService;

import retrofit2.Call;

/**
 * 类说明：
 * 作者：huangqiuxin on 2016/5/13 18:19
 * 邮箱：648859026@qq.com
 */
public class BindMobileAction extends AHttpService<PbBean.PbResUserBindMobile>{
    /**
     * 绑定手机
     * @param context
     * @param mobile
     * @return
     */
    public static BindMobileAction newInstance(Context context, String mobile){
        return new BindMobileAction(context, mobile);
    }
    private String mobile;
    private BindMobileAction(Context context, String mobile) {
        super(context);
        this.mobile = mobile;
    }

    @Override
    protected Call newRetrofitCall(ApiService apiService, PbBean.PbBaseClientInfo.Builder baseBuilder) {
        PbBean.PbReqUserBindMobile.Builder builder = PbBean.PbReqUserBindMobile.newBuilder();
        builder.setBaseClientInfo(baseBuilder);
        builder.setMobile(mobile);

        return apiService.bindMobile(builder.build());
    }
}
